<div id="main_container">

	<?php if($this->promo->is_set()) echo $this->promo; ?>

    <div id="content_wrap" class="grid_16">

		<div id="content_container"> 

		<?php 

		if(isset($custom)) 
			$this->load->view('custom/'.$custom); 
		else {

			if($this->headbar->is_set()) echo $this->headbar; 
			if($this->sidebar->is_set()) echo $this->sidebar;

			if($this->main_content->is_set()){

				echo $this->main_content;

			} else if(isset($main_content)) {
				$this->load->view('content/'.$main_content);
			}

			$scripts = $this->main_content->get_scripts();
			if(count($scripts) > 0){
				foreach($scripts as $script => $bool){
					$this->load->view("scripts/$script");
				}
			}
		}
		

		?> 
		</div>
    </div>
</div>
